package com.chat.mapper;

import com.chat.entity.CarpoolOrder;
import com.github.pagehelper.Page;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface CarpoolOrderMapper {

    //添加拼车订单信息
    @Insert("insert into order_carpool (order_id, departure, destination, departure_time, " +
            "create_time, update_time, number_of_people, remark, status, stuNumber, username, phone) " +
            "VALUES (#{orderId},#{departure},#{destination},#{departureTime},#{createTime},#{updateTime},#{numberOfPeople}," +
            "#{remark},#{status},#{stuNumber},#{username},#{phone})")
    void addCarpool(CarpoolOrder carpoolOrder);


    //查询拼车订单信息
    @Select("select * from order_carpool")
    Page<CarpoolOrder> getCarpool();
}
